function [ outputsWeekly,outputsDaily ] = predictionWeek( inputs,net )
%PREDICTIONWEEK Summary of this function goes here
%   Detailed explanation goes here

[inputs2,settings2] = mapminmax(inputs');
P2=inputs2(end-4:end);

% Normalization Data
%normalize input between 1,-1
% P2=P2';
% [P2,settings2]=mapminmax(P2);

%[T2,settings2Target]=mapminmax(T2);
% Outputs of the neural previous trained
outputsWeekly(1)=net(P2(:));%next day prediction =T2(1)
outputsWeekly(2)=net([P2(2:5) outputsWeekly(1)]');% second day
outputsWeekly(3)=net([P2(3:5) outputsWeekly(1) outputsWeekly(2)]');
outputsWeekly(4)=net([P2(4:5) outputsWeekly(1) outputsWeekly(2) outputsWeekly(3)]');
outputsWeekly(5)=net([P2(5) outputsWeekly(1) outputsWeekly(2) outputsWeekly(3) outputsWeekly(4)]');

%%
outputsWeekly = mapminmax('reverse',outputsWeekly',settings2);%Dernormalization
outputsDaily=sim(net,P2(:));
outputsDaily = mapminmax('reverse',outputsDaily',settings2);%Dernormalization
P2 = mapminmax('reverse',P2',settings2);%Dernormalization
%% 
close all
hold on
vectorSalida = [P2 ;outputsWeekly];
vectorSalida = vectorSalida -vectorSalida(1);
plot(vectorSalida,'--r')
plot(P2-P2(1));
title PrevisionAcciones
legend Forecast UltimosDatos
outputsWeekly=vectorSalida;
 saveas(gcf, 'Forecast', 'jpg')


end

